﻿/*
 * FileName: cPlayer.cs
 * Module: Core
 * Author: Gourav Das
 * Created: 04/2011
 * Modifications:
 * Copyright: Gourav Das, 2011
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _22yards.Core
{
    public class cPlayer
    {
        public string Name { get; set; }
        public int PlayerID { get; set; }
        public decimal NetMoney { get; set; }
        public bool IsOnStrike { get; set; }

        public bool IsBowlingCurrently { get; set; }

        public bool IsSetToBowlNext { get; set; }

        public bool InPlaying11 { get; set; }
        public bool Is12thMan { get; set; }
        public bool IsWicketKeeper { get; set; }
        public bool IsCaptain { get; set; }
        public bool InSquadOf15 { get; set; }
        public bool IsRightHandedBatsman { get; set; }
        public bool IsRightHandedBowler { get; set; }
        public bool IsRightHandedFielder { get; set; }
        public bool IsUpdatable { get; set; }
        public short BowlerType { get; set; }
        public short StageInCareer { get; set; } //40 - street, 30 - park, 20 - Domestic, 10 - Intl
        public short Fined { get; set; }

        public short CareerBattingAura { get; set; }
        public short SeriesBattingConfidence { get; set; }
        public short CurrentBattingConfidence { get; set; }
        public short BatsmanSettledOnPitch { get; set; } //only for batsman
        public short Volatility { get; set; } //How quickly player can be unsettled

        public short CareerBowlingAura { get; set; }
        public short SeriesBowlingConfidence { get; set; }
        public short CurrentBowlingConfidence { get; set; }
        public float UpperBowlingSpeedLimit { get; set; }

        public short CareerFieldingAura { get; set; }
        public short SeriesFieldingConfidence { get; set; }
        public short CurrentFieldingConfidence { get; set; }

        //All these r now fetched from Score class, courtesy CBall class
        //public short BallsBowledCurrentInnings { get; set; }
        //public int RunsConceededCurrentInnings { get; set; }
        //public int ExtrasBowledCurrentInnings { get; set; }
        //public int SixesConceededCurrentInnings { get; set; }
        //public int FoursConceededCurrentInnings { get; set; }
        //public int WicketsTakenCurrentInnings { get; set; }

        public int BallsBowledCurrentOver { get; set; }
        public int RunsConceededCurrentOver { get; set; }
        public int ExtrasBowledCurrentOver { get; set; }
        public int SixesConceededCurrentOver { get; set; }
        public int FoursConceededCurrentOver { get; set; }
        public int WicketsTakenCurrentOver { get; set; }

        //All these r now fetched from Score class, courtesy CBall class
        //public int BallsFacedCurrentInnings { get; set; }
        //public int RunsScoredCurrentInnings { get; set; }
        //public int BoundariesHitCurrentInnings { get; set; }
        //public int SixesHitCurrentInnings { get; set; }
        //public int DotsCurrentInnings { get; set; }
        //public int OnesCurrentInnings { get; set; }
        // int TwosCurrentInnings { get; set; }
        //public int ThreesCurrentInnings { get; set; }

        public bool IsOut { get; set; }

        public bool IsBatting { get; set; }

        public int CatchesCaughtCurrentInnings { get; set; }
        public int CatchesDroppedCurrentInnings { get; set; }

        //Injury and stamina
        public bool InjuryProne { get; set; }              //yes or no, decided randomly
        public short LevelOfInjury { get; set; }             //0 to 100. 100 -> permanently disabled
        public short NumInjured { get; set; }                //Number of times injured
        public short Stamina { get; set; }
        public short Strength { get; set; }
        public short InjuryLength { get; set; }
        

        //International
        public short NumT20Matches { get; set; }
        public short NumT20NotOuts { get; set; }
        public short T20Ranking { get; set; }
        public short Num5050Matches { get; set; }
        public short Num5050NotOuts { get; set; }
        public short ODIRanking { get; set; }
        public short NumTestMatches { get; set; }
        public short NumTestNotOuts { get; set; }
        public short TestRanking { get; set; }

        public short NumT20Innings { get; set; }
        public short Num5050Innings { get; set; }
        public short NumTestInnings { get; set; }

        //Streets and Parks
        public short NumStreetMatches { get; set; }
        public short StreetRanking { get; set; }
        public short NumStreetNotOuts { get; set; }
        public short NumParkMatches { get; set; }
        public short ParkRanking { get; set; }
        public short NumParkNotOuts { get; set; }
        public short NumStreetInnings { get; set; }
        public short NumParkInnings { get; set; }

        public short NumCustomMatches { get; set; }
        public short NumCustomNotOuts { get; set; }
        public short NumCustomInnings { get; set; }
        public short CustomRanking { get; set; }
        public DateTime FirstCustomMatch { get; set; }
        
        //First Class
        public short NumFirstClassT20Matches { get; set; }
        public short NumFirstClass5050Matches { get; set; }
        public short NumFirstClass4DayMatches { get; set; }
        public short NumFirstClass5DayMatches { get; set; }

        public short NumFirstClassT20Innings { get; set; }
        public short NumFirstClass5050Innings { get; set; }
        public short NumFirstClass4DayInnings { get; set; }
        public short NumFirstClass5DayInnings { get; set; }

        public short NumFirstClassT20NotOuts { get; set; }
        public short NumFirstClass5050NotOuts { get; set; }
        public short NumFirstClass4DayNotOuts { get; set; }
        public short NumFirstClass5DayNotOuts { get; set; }
        public short DomesticTestRanking { get; set; }
        public short Domestic5050Ranking { get; set; }
        public short DomesticT20Ranking { get; set; }


        public DateTime DateOfBirth { get; set; }
        public DateTime FirstStreetMatch { get; set; }
        public DateTime FirstParkmatch { get; set; }
        public DateTime FirstT20Match { get; set; }
        public DateTime First5050Match { get; set; }
        public DateTime FirstTestMatch { get; set; }
        public DateTime FirstDOMT20Match { get; set; }
        public DateTime FirstDOM5050Match { get; set; }
        public DateTime FirstDOM4DayMatch { get; set; }
        public DateTime FirstDOM5DayMatch { get; set; }
        
        public short TestCareerRuns { get; set; }
        public short TestCareerCenturies { get; set; }
        public short TestCareerHalfCenturies { get; set; }
        public short TestCareerHighestScore { get; set; }
        public decimal TestCareerBattingAvg { get; set; }
        public decimal TestCareerBattingSR { get; set; }
        public decimal TestCareerOversBowled { get; set; }
        public short TestCareerWickets { get; set; }
        public short TestCareerFiveWicketHaul { get; set; }
        public short TestCareerTenWicketHaul { get; set; }
        public decimal TestCareerBestBowlingFigue { get; set; }
        public decimal TestCareerBowlingAvg { get; set; }
        public decimal TestCareerBowlingSR { get; set; }
        public short TestCareerCatches { get; set; }

        public short ODICareerRuns { get; set; }
        public short ODICareerCenturies { get; set; }
        public short ODICareerHalfCenturies { get; set; }
        public short ODICareerHighestScore { get; set; }
        public decimal ODICareerBattingAvg { get; set; }
        public decimal ODICareerBattingSR { get; set; }
        public decimal ODICareerOversBowled { get; set; }
        public short ODICareerWickets { get; set; }
        public short ODICareerFiveWicketHaul { get; set; }
        public short ODICareerTenWicketHaul { get; set; }
        public decimal ODICareerBestBowlingFigue { get; set; }
        public decimal ODICareerBowlingAvg { get; set; }
        public decimal ODICareerBowlingSR { get; set; }
        public short ODICareerCatches { get; set; }

        public short T20CareerRuns { get; set; }
        public short T20CareerCenturies { get; set; }
        public short T20CareerHalfCenturies { get; set; }
        public short T20CareerHighestScore { get; set; }
        public decimal T20CareerBattingAvg { get; set; }
        public decimal T20CareerBattingSR { get; set; }
        public decimal T20CareerOversBowled { get; set; }
        public short T20CareerWickets { get; set; }
        public short T20CareerFiveWicketHaul { get; set; }
        public short T20CareerTenWicketHaul { get; set; }
        public decimal T20CareerBestBowlingFigue { get; set; }
        public decimal T20CareerBowlingAvg { get; set; }
        public decimal T20CareerBowlingSR { get; set; }
        public short T20CareerCatches { get; set; }

        public short DOM5DAYCareerRuns { get; set; }
        public short DOM5DAYCareerCenturies { get; set; }
        public short DOM5DAYCareerHalfCenturies { get; set; }
        public short DOM5DAYCareerHighestScore { get; set; }
        public decimal DOM5DAYCareerBattingAvg { get; set; }
        public decimal DOM5DAYCareerBattingSR { get; set; }
        public decimal DOM5DAYCareerOversBowled { get; set; }
        public short DOM5DAYCareerWickets { get; set; }
        public short DOM5DAYCareerFiveWicketHaul { get; set; }
        public short DOM5DAYCareerTenWicketHaul { get; set; }
        public decimal DOM5DAYCareerBestBowlingFigue { get; set; }
        public decimal DOM5DAYCareerBowlingAvg { get; set; }
        public decimal DOM5DAYCareerBowlingSR { get; set; }
        public short DOM5DAYCareerCatches { get; set; }

        public short DOM4DAYCareerRuns { get; set; }
        public short DOM4DAYCareerCenturies { get; set; }
        public short DOM4DAYCareerHalfCenturies { get; set; }
        public short DOM4DAYCareerHighestScore { get; set; }
        public decimal DOM4DAYCareerBattingAvg { get; set; }
        public decimal DOM4DAYCareerBattingSR { get; set; }
        public decimal DOM4DAYCareerOversBowled { get; set; }
        public short DOM4DAYCareerWickets { get; set; }
        public short DOM4DAYCareerFiveWicketHaul { get; set; }
        public short DOM4DAYCareerTenWicketHaul { get; set; }
        public decimal DOM4DAYCareerBestBowlingFigue { get; set; }
        public decimal DOM4DAYCareerBowlingAvg { get; set; }
        public decimal DOM4DAYCareerBowlingSR { get; set; }
        public short DOM4DAYCareerCatches { get; set; }

        public short DOMODICareerRuns { get; set; }
        public short DOMODICareerCenturies { get; set; }
        public short DOMODICareerHalfCenturies { get; set; }
        public short DOMODICareerHighestScore { get; set; }
        public decimal DOMODICareerBattingAvg { get; set; }
        public decimal DOMODICareerBattingSR { get; set; }
        public decimal DOMODICareerOversBowled { get; set; }
        public short DOMODICareerWickets { get; set; }
        public short DOMODICareerFiveWicketHaul { get; set; }
        public short DOMODICareerTenWicketHaul { get; set; }
        public decimal DOMODICareerBestBowlingFigue { get; set; }
        public decimal DOMODICareerBowlingAvg { get; set; }
        public decimal DOMODICareerBowlingSR { get; set; }
        public short DOMODICareerCatches { get; set; }

        public short DOMT20CareerRuns { get; set; }
        public short DOMT20CareerCenturies { get; set; }
        public short DOMT20CareerHalfCenturies { get; set; }
        public short DOMT20CareerHighestScore { get; set; }
        public decimal DOMT20CareerBattingAvg { get; set; }
        public decimal DOMT20CareerBattingSR { get; set; }
        public decimal DOMT20CareerOversBowled { get; set; }
        public short DOMT20CareerWickets { get; set; }
        public short DOMT20CareerFiveWicketHaul { get; set; }
        public short DOMT20CareerTenWicketHaul { get; set; }
        public decimal DOMT20CareerBestBowlingFigue { get; set; }
        public decimal DOMT20CareerBowlingAvg { get; set; }
        public decimal DOMT20CareerBowlingSR { get; set; }
        public short DOMT20CareerCatches { get; set; }

        public short StreetCareerRuns { get; set; }
        public short StreetCareerCenturies { get; set; }
        public short StreetCareerHalfCenturies { get; set; }
        public short StreetCareerHighestScore { get; set; }
        public decimal StreetCareerBattingAvg { get; set; }
        public decimal StreetCareerBattingSR { get; set; }
        public decimal StreetCareerOversBowled { get; set; }
        public short StreetCareerWickets { get; set; }
        public short StreetCareerFiveWicketHaul { get; set; }
        public short StreetCareerTenWicketHaul { get; set; }
        public decimal StreetCareerBestBowlingFigue { get; set; }
        public decimal StreetCareerBowlingAvg { get; set; }
        public decimal StreetCareerBowlingSR { get; set; }
        public short StreetCareerCatches { get; set; }

        public short ParkCareerRuns { get; set; }
        public short ParkCareerCenturies { get; set; }
        public short ParkCareerHalfCenturies { get; set; }
        public short ParkCareerHighestScore { get; set; }
        public decimal ParkCareerBattingAvg { get; set; }
        public decimal ParkCareerBattingSR { get; set; }
        public decimal ParkCareerOversBowled { get; set; }
        public short ParkCareerWickets { get; set; }
        public short ParkCareerFiveWicketHaul { get; set; }
        public short ParkCareerTenWicketHaul { get; set; }
        public decimal ParkCareerBestBowlingFigue { get; set; }
        public decimal ParkCareerBowlingAvg { get; set; }
        public decimal ParkCareerBowlingSR { get; set; }
        public short ParkCareerCatches { get; set; }

        public short CustomCareerRuns { get; set; }
        public short CustomCareerCenturies { get; set; }
        public short CustomCareerHalfCenturies { get; set; }
        public short CustomCareerHighestScore { get; set; }
        public decimal CustomCareerBattingAvg { get; set; }
        public decimal CustomCareerBattingSR { get; set; }
        public decimal CustomCareerOversBowled { get; set; }
        public short CustomCareerWickets { get; set; }
        public short CustomCareerFiveWicketHaul { get; set; }
        public short CustomCareerTenWicketHaul { get; set; }
        public decimal CustomCareerBestBowlingFigue { get; set; }
        public decimal CustomCareerBowlingAvg { get; set; }
        public decimal CustomCareerBowlingSR { get; set; }
        public short CustomCareerCatches { get; set; }

        public cPlayer(DateTime Dob)
        {
            BattingSkillPoints = 0;
            BowlingSkillPoints = 0;
            FieldingSkillPoints = 20;
            Stamina = 20;
            Num5050Matches = 0;
            NumFirstClass4DayMatches = 0;
            NumFirstClass5050Matches = 0;
            NumFirstClass5DayMatches = 0;
            NumFirstClassT20Matches = 0;
            NumInjured = 0;
            NumParkMatches = 0;
            NumStreetMatches = 0;
            NumT20Matches = 0;
            NumTestMatches = 0;
            LevelOfInjury = 0; 
            DateOfBirth = Dob;
            First5050Match = System.DateTime.MinValue;
            FirstDOM4DayMatch = System.DateTime.MinValue;
            FirstDOM5050Match = System.DateTime.MinValue;
            FirstDOM5DayMatch = System.DateTime.MinValue;
            FirstDOMT20Match = System.DateTime.MinValue;
            FirstParkmatch = System.DateTime.MinValue;
            FirstStreetMatch = System.DateTime.MinValue;
            FirstT20Match = System.DateTime.MinValue;
            FirstTestMatch = System.DateTime.MinValue;
            IsBatting = false;
            IsOut = false;
            IsOnStrike = false;
        }

        #region BattingSkills

        public short BattingSkillPoints { get; set; }
        public int FavouriteBattingRegion { get; set; }
        public short FavouriteBattingShot { get; set; }
        public bool SuperAgressive { get; set; }
        
        #endregion

        #region BowlingSkills

        public short BowlingSkillPoints { get; set; }
        //public short FavouriteBowlingRegion { get; set; }
        public short FastBowlingPoints { get; set; }
        public short SpinBowlingPoints { get; set; }
        public short BowlingRunupLength { get; set; }
        public short BowlingRunupAngle { get; set; }

        #endregion

        #region FieldingSkills

        public short FieldingSkillPoints { get; set; }
        public int FavouriteFieldingPosition { get; set;}
        public short DivingFactor { get; set; } //likeliness of diving
        
        #endregion

    }

}
